package main.od;

import java.util.Arrays;
import java.util.Scanner;

public class BestTreeDistance {
    public static void main(String[] args) {
        // 二分查找最佳距离
        Scanner sc = new Scanner(System.in);
        int locCount = Integer.parseInt(sc.nextLine());
        int[] arr = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int num = Integer.parseInt(sc.nextLine());
        Arrays.sort(arr);
        int min = 0;
        int max = arr[locCount - 1] - arr[0];
        while (min <= max){
            int mid = (max + min) / 2;
            if (compare(arr,mid,num)){
                min = mid + 1;
            }else {
                max = mid - 1;
            }
        }
        System.out.println(max);
    }
    public static boolean compare(int[] arr,int mid,int num){
        int count = 1;
        int cusPos = arr[0];
        for(int i = 1;i < arr.length;i++){
            if (arr[i] - cusPos >= mid){
                count++;
                cusPos = arr[i];
            }
        }
        return count >= num;
    }
}
